//引入刚才的http.js文件
import https from '@/utils/axios';
import apiObj from "./apiObj.js"

//设置个对象，就不用一个个暴露了，直接暴露对象
let apiFun = {
  ...apiObj
};
// 注册页--服务协议
apiFun.serviceItem = function (params) {
  return https.post("/restApi/textProtocol/auth/detail/1", params)
}

// 登录接口
apiFun.toLogin = function (params) {
  return https.post("/restApi/member/auth/login", params)
}
// 我的关注
apiFun.listFollow = function (params) {
  return https.post("/restApi/follow/listFollow", params)
}
// 我的关注-取消关注
apiFun.unFollow = function (params) {
  return https.post("/restApi/follow/unFollow", params)
}
// 我的关注-关注
apiFun.setFollow = function (params) {
  return https.post("/restApi/follow/follow", params)
}
// 我的消息-系统消息红点
apiFun.getNotificationUnread = function (params) {
  return https.post("/restApi/notification/unread", params)
}

// 我的消息-全部设置为已读
apiFun.allRead = function (params) {
  return https.post("/restApi/notification/setReadAll", params)
}


// 我的消息-系统消息列表
apiFun.getSystemList = function (params) {
  return https.post("/restApi/notification/systemList", params)
}
// 我的消息-留言消息列表
apiFun.getMessageList = function (params) {
  return https.post("/restApi/notification/messageList", params)
}
// 我的消息-审核消息列表
apiFun.getReviewList = function (params) {
  return https.post("/restApi/notification/reviewList", params)
}

// 我的消息-删除
apiFun.deleteMessage = function (params) {
  return https.post("/restApi/notification/delete", params)
}

// 已上线产品-列表
apiFun.getPlasticList = function (params) {
  return https.post("/restApi/plasticRawMaterial/list", params)
}
// 已上线产品-剩余可发布数，已可发布数
apiFun.getRemainingNumber = function (params) {
  return https.post("/restApi/plasticRawMaterial/upNumber", params)
}
// 已上线产品-下架
apiFun.takeDown = function (params) {
  return https.post("/restApi/plasticRawMaterial/setStatus", params)
}
// 已上线产品-更新
apiFun.updateRecord = function (params) {
  return https.post("/restApi/updateRecord/add", params)
}

// 已上线产品-详情
apiFun.productDetail = function (params) {
  return https.post("/restApi/plasticRawMaterial/detail/"+params.id, params)
}

// 采购-采购列表
apiFun.getPurchasingList = function (params) {
  return https.post("/restApi/purchasing/list", params)
}
// 采购-发布采购
apiFun.addPurchasing = function (params) {
  return https.post("/restApi/purchasing/add", params)
}
// 采购-删除采购
apiFun.deletePurchasing = function (params) {
  return https.post("/restApi/purchasing/delete", params)
}
// 采购-编辑采购
apiFun.updatePurchasing = function (params) {
  return https.post("/restApi/purchasing/update", params)
}
// 采购-采购详情
apiFun.getPurchasingDetail = function (id) {
  return https.post(`/restApi/purchasing/detail/${id}`)
}
// ------------------分割线-----------------------
// 上传图片
apiFun.uploadImage = function(params){
  return https.post("/util/file/upload",params)
}

// 联系人信息---开通会员
apiFun.openMember = function(params){
  return https.post("/restApi/vipRechargeRecord/getPayParams",params)
}

 // 联系人信息---列表
apiFun.linkmanList = function(params){
  return https.post("/restApi/contact/list",params)
}

// 联系人信息--二维码名片
apiFun.QRcodeInfo = function(params){
  return https.post("/restApi/member/auth/detailUrl/"+params.memberId,params)
}

// 联系人信息---详情
apiFun.linkmanDetail = function(params){
  return https.post("/restApi/contact/detail/"+params.id,params)
}

// 联系人信息---会员权益
apiFun.memberRights = function(params){
  return https.post("/restApi/vip/detail/1",params)
}

// 联系人信息---微信咨询
apiFun.wechatInformation = function(params){
  return https.post("/restApi/textProtocol/auth/detail/1",params)
}

//联系人信息--改变商铺设置
apiFun.changeShops = function(params){
  return https.post("/restApi/contact/shops",params)
}
// 新增联系人
apiFun.addLinkman = function(params){
  return https.post("/restApi/contact/add",params)
}

// 设置密码--获取短信验证码
apiFun.getCode = function(params){
  return https.post("/util/code/getSmsCodeByAliyun",params)
}

// 重置密码
apiFun.resetPwd = function(params){
  return https.post("/restApi/member/auth/resetPwd",params)
}

// 入驻供应商--添加
apiFun.settledSupplier = function(params){
  return https.post("/restApi/enterSupplierInformation/add",params)
}

// 入驻供应商--更新
apiFun.supplierUpdate = function(params){
  return https.post("/restApi/member/updateEnterSupplierInformation",params)
}

// 入驻供应商--数据返回
apiFun.SupplierDetail = function(params){
  return https.post("/restApi/enterSupplierInformation/memberDetail/1",params)
}

// 企业商铺设置
apiFun.setStore = function(params){
  return https.post("/restApi/member/updateEnterSupplierInformation",params)
}

// 企业商铺--数据返回
apiFun.storeDetail = function(params){
  return https.post("/restApi/member/detail/"+params.memberId,params)
}

// 发布供应--提交
apiFun.releaseSupply = function(params){
  return https.post("/restApi/plasticRawMaterial/add",params)
}

// 发布供应--更新
apiFun.saveDraft = function(params){
  return https.post("/restApi/plasticRawMaterial/update",params)
}

// 获取交货简称地
apiFun.getShortPlace = function(params){
  return https.post("/restApi/plasticRawMaterial/getAbbreviationDelivery",params)
}

// 短信营销--公司列表
apiFun.messageMakreting = function(params){
  return https.post("/restApi/intoTheTerminal/auth/list",params)
}

// 短信营销--发送列表
apiFun.sendRocord = function(params){
  return https.post("/restApi/promotionRecord/list",params)
}

// 短信营销--发送列表--查看详情
apiFun.sendRocordDetail = function(params){
  return https.post("restApi/promotionRecord/detail/1184",params)
}

// 短信营销--本月剩余和投递条数
apiFun.statisticCount= function(params){
  return https.post("/restApi/theDeliveryRecord/getTheDeliveryRecord",params)
}
// -------------------------------------------
// 短信营销--新增订单
apiFun.newOrder= function(params){
  return https.post("/restApi/theDeliveryRecord/add",params)
}

// 短信营销--查询是否有已支付未发送的记录
apiFun.checkRecord= function(params){
  return https.post("/restApi/theDeliveryRecord/getUnsent",params)
}

// 短信营销--支付订单
apiFun.payOrder= function(params){
  return https.post("/restApi/theDeliveryRecord/getPayParams",params)
}

// 短信营销--支付成功后推广
apiFun.sendPromote= function(params){
  return https.post("/restApi/promotionRecord/add",params)
}
// ------------------------------------------

// 短信营销--短信模板
apiFun.sendTemplete= function(params){
  return https.post("/restApi/promotionTemplate/add",params)
}

// 短信营销--模板详情
apiFun.TempleteDetail= function(params){
  return https.post("/restApi/promotionTemplate/detail",params)
}

// 广告投放
// apiFun.putAds = function(params){
//   return https.post("/restApi/config/auth/detail",params)
// }
// 广告投放
apiFun.putAds = function(params){
  return https.post("/restApi/banner/detailGuangGao",params)
}

// 联系客服
apiFun.connectServices = function(params){
  return https.post("/restApi/textProtocol/auth/detail/1",params)
}

// 帮助中心--问题列表
apiFun.questionList = function(params){
  return https.post("/restApi/faq/list",params)
}

// 帮助中心--问题详情
apiFun.questionDetail = function(params){
  return https.post("/restApi/faq/detail/"+params.id,params)
}

// 反馈意见
apiFun.submitFeedback = function(params){
  return https.post("/restApi/feedback/add",params)
}

//发布供应--品名列表
apiFun.brandList = function(params){
  return https.post("/restApi/product/auth/list",params)
}

//发布供应--厂家列表
apiFun.companyList = function(params){
  return https.post("/restApi/manufacturers/auth/list",params)
}

//发布供应--牌号列表
apiFun.markList = function(params){
  return https.post("/restApi/mark/auth/list",params)
}

//发布供应--规则提示
apiFun.ruleNotice = function(params){
  return https.post("/restApi/vip/detail/1",params)
}

//原料行情列表
apiFun.rawMaterialPrices = function(params){
  return https.post("/restApi/rawMaterialPrices/auth/list",params)
}

//获取原油列表
apiFun.crudeList = function(params){
  return https.post("/restApi/crude/auth/list",params)
}

//获取品名列表
apiFun.getProductName = function(params){
  return https.post("/restApi/rawMaterialPrices/getProductName",params)
}

//折线图页详情
apiFun.lineChart = function(params){
  return https.post("/restApi/marketPrice/lineChart", params)
}

//折线图页数据
apiFun.lineChartDetail = function(params){
  return https.post("/restApi/rawMaterialPrices/detail/" + params)
}

//历史价格数据
apiFun.history = function(params){
  return https.post("/restApi/marketPrice/list", params)
}

//获取会员介绍
apiFun.textProtocol = function(params){
  return https.post("/restApi/vip/detail/" + params)
}

//暴露出这个对象
export default apiFun;

